package com.eeds.controller.pc;

import com.eeds.base.BaseController;
import com.eeds.common.model.BaseWrapper;
import com.eeds.interceptor.NeedAuth;
import com.eeds.model.index.res.ResGetWelcomeInfoVO;
import com.eeds.model.index.res.ResGetWelcomeProclamationInfoVO;
import com.eeds.service.index.IndexService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(value = "主页接口", description = "主页接口")
@RequestMapping("pc/index/")
public class IndexController extends BaseController {

    @Autowired
    private IndexService indexService;

    /**
     * description:获取欢迎页数据
     * @author: Flying
     * @date: 2018-08-28 12:31
     * @param: null
     * @return
     */
    @NeedAuth
    @RequestMapping(value = "/getWelcomeInfo", method = RequestMethod.GET)
    @ApiOperation("获取欢迎页数据")
    public BaseWrapper<ResGetWelcomeInfoVO> getWelcomeInfo(){
        ResGetWelcomeInfoVO result =
                indexService.getWelcomeInfo();
        return new BaseWrapper<>(result);
    }

    /**
     * description:获取欢迎页公告数据
     * @author: Flying
     * @date: 2018-08-28 12:31
     * @param: null
     * @return
     */
    @NeedAuth
    @RequestMapping(value = "/getWelcomeProclamationInfo", method = RequestMethod.GET)
    @ApiOperation("获取欢迎页公告数据")
    public BaseWrapper<ResGetWelcomeProclamationInfoVO> getWelcomeProclamationInfo(){
        ResGetWelcomeProclamationInfoVO result =
                indexService.getWelcomeProclamationInfo();
        return new BaseWrapper<>(result);
    }


}
